import 'package:baselib/widgets/loading_dialog.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

/**
 * 数据模拟加载
 */
class LoadUtil{
  static showLoad({BuildContext context,String loadingText:'loading...',bool canceledOnTouchOutside}){
    Navigator.push(context??(Get.context), DialogRouter(LoadingDialog(canceledOnTouchOutside??true,loadingText: loadingText,)));
  }
  static hideLoad({BuildContext context}){
    if( Navigator.of(context??(Get.context)).canPop()){
      Navigator.of(context??(Get.context)).pop();
    }
  }
}